package com.sudytech.ucp.serv;

public class UcpWebServProxy implements com.sudytech.ucp.serv.UcpWebServ_PortType {
  private String _endpoint = null;
  private com.sudytech.ucp.serv.UcpWebServ_PortType ucpWebServ_PortType = null;
  
  public UcpWebServProxy() {
    _initUcpWebServProxy();
  }
  
  public UcpWebServProxy(String endpoint) {
    _endpoint = endpoint;
    _initUcpWebServProxy();
  }
  
  private void _initUcpWebServProxy() {
    try {
      ucpWebServ_PortType = (new com.sudytech.ucp.serv.UcpWebServ_ServiceLocator()).getUcpWebServPort();
      if (ucpWebServ_PortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)ucpWebServ_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)ucpWebServ_PortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (ucpWebServ_PortType != null)
      ((javax.xml.rpc.Stub)ucpWebServ_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.sudytech.ucp.serv.UcpWebServ_PortType getUcpWebServ_PortType() {
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType;
  }
  
  public com.sudytech.ucp.serv.SendResult sendMessage(int boxId, com.sudytech.ucp.serv.Message message, java.lang.Integer[] channels, boolean usesSignature, java.util.Calendar plannedTime, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.sendMessage(boxId, message, channels, usesSignature, plannedTime, serviceToken);
  }
  
  public java.lang.String addAttachment(java.lang.String messageId, com.sudytech.ucp.serv.Attachment attachment, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.addAttachment(messageId, attachment, serviceToken);
  }
  
  public boolean deleteAttachment(java.lang.String messageId, java.lang.String attachmentId, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.deleteAttachment(messageId, attachmentId, serviceToken);
  }
  
  public java.lang.String createMessage(int boxId, com.sudytech.ucp.serv.Message message, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.createMessage(boxId, message, serviceToken);
  }
  
  public boolean deleteMessage(java.lang.String messageId, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.deleteMessage(messageId, serviceToken);
  }
  
  public com.sudytech.ucp.serv.SendResult sendSavedMessage(java.lang.String messageId, java.lang.Integer[] channels, boolean usesSignature, java.util.Calendar plannedTime, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.sendSavedMessage(messageId, channels, usesSignature, plannedTime, serviceToken);
  }
  
  public com.sudytech.ucp.serv.SendResult sendIndivMessage(int boxId, com.sudytech.ucp.serv.Message message, java.lang.Integer[] channels, boolean usesSignature, int solution, java.lang.String datasrc, java.lang.String idvidualParams, java.util.Calendar plannedTime, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.sendIndivMessage(boxId, message, channels, usesSignature, solution, datasrc, idvidualParams, plannedTime, serviceToken);
  }
  
  public com.sudytech.ucp.serv.SendResult sendIndivSavedMessage(java.lang.String messageId, java.lang.Integer[] channels, boolean usesSignature, int solution, java.lang.String datasrc, java.lang.String idvidualParams, java.util.Calendar plannedTime, java.lang.String serviceToken) throws java.rmi.RemoteException, com.sudytech.ucp.serv.MessageException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.sendIndivSavedMessage(messageId, channels, usesSignature, solution, datasrc, idvidualParams, plannedTime, serviceToken);
  }
  
  public int getMessageDeliverCount(java.lang.String messageId, int channel, java.lang.String serviceToken) throws java.rmi.RemoteException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.getMessageDeliverCount(messageId, channel, serviceToken);
  }
  
  public com.sudytech.ucp.serv.ChannelDeliverState[] getMessageDelivers(java.lang.String messageId, int channel, int beginIndex, int count, java.lang.String serviceToken) throws java.rmi.RemoteException{
    if (ucpWebServ_PortType == null)
      _initUcpWebServProxy();
    return ucpWebServ_PortType.getMessageDelivers(messageId, channel, beginIndex, count, serviceToken);
  }
  
  
}